import React, { Component } from 'react'
import axios from "axios"
import Left from './left'
import Right from './right'
 class App extends Component {
    state = {
        arr:[]
    }
   componentDidMount() { //相当于vue得mountd
        axios.get("/list1").then(res=>{
            console.log(res.data)
            this.setState({
                arr:res.data.list
            })
        })
   }
  render() {
    return (
      <div className='wrap'>
        {
           this.state.arr&& this.state.arr.length?<Left send={this.state.arr}></Left>:"暂无数据"
        }
        {
            this.state.arr&& this.state.arr.length?  <Right send={this.state.arr}></Right>:"暂无数据"
        }
        
      </div>
    )
  }
}

export default App